<style>
.right_side_operate_area .item_add_btn a{
	margin-top:6px;
	margin-bottom:6px;
}
</style>
<div class="right_side_operate_area">
    <div class="right item_add_btn">
		<?php 
			$str_title=__("Edit",true);
    		echo $html->link(__("Cancel",true).$str_title,"/notices/index/");
    	?>
	</div>
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
<div class="detail_info_panel">
<?php
echo $form->create('Notice', array('action' => 'edit','onsubmit' => "return checkginfo()"));
?>
<br/>
<div class="details_item_line">
	<div class="details_item">
	    <div class="form_left_title left"><?php __("Notice Title")?>：</div>
	    <div class="form_right_e_input left"><?php echo $form->text('Notice.title',array('style'=>'width:600px;height:25px;'));?></div>
	    <div id='groupnamemessage' style='display:none;' class="error_message">请填写部门名</div>
		<div id='noticetitlemessage' style='display:none;' class="error_message">请输入公告标题</div>
	</div>
</div>
<div class="details_item_line">
	<div class="details_item">
	    <div class="form_left_title left"><?php __("Notice Content")?>：</div>
	    <div class="form_right_e_input left"><?php echo $form->textarea('Notice.content',array('class' => 'form_textarea','style'=>'width:600px;height:250px;'));?></div>
		<div id='noticecontentmessage' style='display:none;' class="error_message">请输入内容</div>
	</div>
</div>
<div class="details_item_line">
	<div class="details_item">
	    <div class="form_left_title left" style='width:auto;'><div style='font-size:10pt;margin:0 0 10px 55px;' class="ajax_file_list">附件：&nbsp;&nbsp;
		<?php foreach( $attachments as $attachment ): ?>
<a href="javascript:;" onclick="delete_ajax_file(this)" id="<?php echo $attachment['Attachment']['id']?>"><?php echo $attachment['Attachment']['file_name'];?>;</a>
<input type="hidden" name="upload[]" value="<?php echo $attachment['Attachment']['id']?>">
<?php endforeach; ?>
		</div></div>
		<div class="form_right_e_input left"><input type="file" style="width: 100%;"  class="ajax_upload_file"></div>
	</div>
</div>
<?php
echo $form->input('Notice.id', array('type'=>'hidden'));
?>
<div class="details_item_line">
	<div class="details_item">
	    <div class="form_left_title left"></div>
		<div class="form_add_submit left">
	    <?php echo $form->submit(__('Save',true), array("id"=>"adduser","name"=>"submit","class"=>"buttom","div"=>false));  ?>
	    </div>
	</div>
</div>
</div>
</div>
<script>
function checkginfo(){
	  if($("#NoticeTitle").val().trim() == ''){
			$("#noticetitlemessage").css('display','block');
			return false;
		  }else{
		 	 $("noticetitlemessage").css('display','none');
      }
	  
	  if($("#NoticeContent").val().trim() == ''){
			$("#noticecontentmessage").css('display','block');
			return false;
		  }else{
		 	$("#noticecontentmessage").css('display','none');
	  }
}
ajax_upload_file('ajax_upload_file','ajax_file_list');
</script>